#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QScrollBar>
#include <QDebug>
#include <QMessageBox>
#include <QDBusInterface>
#include <QDBusConnection>
#include <QDBusReply>
#include <QCloseEvent>
#include <QWidget>
#include <QMouseEvent>
#include <QTimer>
#include "cmdthread.h"
#include "title.h"
#include "tip_widget.h"
#include "top_widget.h"
#include "massage_widget.h"
#include "quit_widget.h"

class MainWindow : public QWidget
{
    Q_OBJECT

public:
    explicit MainWindow(QString LaunchMode,QWidget *parent = 0);
    ~MainWindow();

//    void getCurrentVersion();
    void autoScroll();
    void copy_fileto_server(QString);
    void rm_lockfile();

    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

    CMDThread *ct;
    Title_bar *titlewidget;
    Tip_Widget *tipwidget;
    Top_Widget *topwidget;
    Massage_Widget *massagewidge;
    Quit_Widget *quitwidget;
    Quit_Widget *determine_widget;
    bool m_move;
    QPoint m_startPoint;
    QPoint m_windowPoint;
    QTimer *time0;
    QTimer *show_time;
    int flag;
    QString send_filename = "";
    QString Launch_Mode = "";

public slots:
    void on_cmd_out(QString);
    void messagebox();
    void clicked_close_btn();
    void clicked_upgrade_btn();
    void clicked_backup_btn();
    void clicked_mini_btn();
    void show_quit_widget(int);
    void slot_timeout();
    void show_click_upgrade();
    void clicked_reduction_btn();
    void slot_get_file_name(QString);
    void clicked_determinewidget_close_btn();
    void hide_mainwindow();
    //void closeEvent();
//    void pb_startupdate_enabled();

private slots:
    void reboot();
    void lower_battery();
//    void on_pb_startupdate_clicked();

};

#endif // MAINWINDOW_H
